package learn.ch1;

/**
 * @Description todo
 * @Author yusj
 * @Date 2021/12/12
 * @Version 1.0
 */
public class Ts02 extends Thread{

    private Sv01 sv01;

    public Ts02(Sv01 sv01, String name){
        this.sv01=sv01;
        super.setName(name);
    }

    @Override
    public void run() {
        sv01.done();
    }

    public static void main(String[] args){
        Sv01 sv01=new Sv01();

        //01  sleep  100ms 后调用。01 直接调用。
        Ts01 ts01=new Ts01(sv01,"ts01");
        Ts02 ts02=new Ts02(sv01,"ts02");
        Ts01 ts01_1=new Ts01(sv01,"ts01_1");
        Ts01 ts01_2=new Ts01(sv01,"ts01_2");
        Ts02 ts02_1=new Ts02(sv01,"ts02_1");
        Ts02 ts02_2=new Ts02(sv01,"ts02_2");

        ts01.start();
        ts02.start();
        ts01_1.start();
        ts01_2.start();
        ts02_1.start();
        ts02_2.start();

    }

}
